/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题色彩 - 明亮活泼的配色方案 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* 背景色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* 边框和阴影 */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* 字体 */
    --font-family: 'ZCOOL XiaoWei', 'Microsoft YaHei', sans-serif;
    --font-fun: 'ZCOOL KuaiLe', cursive;
    
    /* 动画时长 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.book-icon {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

.header h1 {
    font-size: 2.5rem;
    font-family: var(--font-fun);
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 故事展示区 */
.story-display {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.story-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-gradient);
}

.story-container {
    font-size: 1.1rem;
    line-height: 1.8;
}

.story-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.magic-wand {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: magic 1.5s ease-in-out infinite;
}

.story-placeholder h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.story-placeholder p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section,
.ai-response-section,
.continue-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.input-section:hover {
    transform: translateY(-2px);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.input-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-family);
    resize: vertical;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--bg-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon {
    font-size: 1.1rem;
}

/* AI响应区域 */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ai-response {
    animation: fadeInUp 0.5s ease;
}

.response-content {
    background: linear-gradient(135deg, #f6f8fb 0%, #f1f5f9 100%);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.response-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 故事统计 */
.story-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stats-item {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform var(--transition-normal);
}

.stats-item:hover {
    transform: translateY(-5px);
}

.stats-icon {
    font-size: 2rem;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 底部工具栏 */
.footer {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tool-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.tool-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-normal);
}

.modal-close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes magic {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .story-display {
        padding: 20px;
        min-height: 250px;
    }
    
    .input-section,
    .ai-response-section,
    .continue-section {
        padding: 20px;
    }
    
    .story-stats {
        grid-template-columns: 1fr;
    }
    
    .response-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .book-icon {
        font-size: 2rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .toolbar {
        gap: 5px;
    }
    
    .tool-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
    }
    
    body {
        background-image: 
            radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    }
}

/* 模式选择器 */
.mode-selector {
    margin-bottom: 30px;
}

.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-secondary);
}

.mode-tab:hover {
    background: var(--bg-tertiary);
}

.mode-tab.active {
    background: var(--bg-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.mode-icon {
    font-size: 1.2rem;
}

.mode-content {
    animation: fadeIn 0.3s ease;
}

/* 成语接龙模式样式 */
.idiom-game-display {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    min-height: 300px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.idiom-game-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
}

.idiom-chain-container {
    font-size: 1.1rem;
    line-height: 1.8;
}

.idiom-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.idiom-wand {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: magic 1.5s ease-in-out infinite;
}

.idiom-placeholder h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.idiom-placeholder p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 成语链显示 */
.idiom-chain {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.idiom-item {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    border-radius: var(--border-radius);
    animation: slideInLeft 0.5s ease;
}

.idiom-item.user {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: var(--primary-color);
}

.idiom-item.ai {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-left-color: var(--accent-color);
}

.idiom-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.idiom-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-primary);
    font-family: var(--font-fun);
}

.idiom-number {
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.idiom-story-content {
    line-height: 1.6;
    color: var(--text-primary);
}

/* 成语控制面板 */
.idiom-control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.idiom-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.idiom-input-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-family: var(--font-family);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.idiom-input-wrapper input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.idiom-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.idiom-hint-display {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.idiom-hint-display span {
    color: var(--secondary-color);
    font-weight: bold;
}

/* 成语信息卡片 */
.idiom-card {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--secondary-color);
}

.idiom-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(245, 158, 11, 0.2);
}

.idiom-text {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-family: var(--font-fun);
}

.idiom-pinyin {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.idiom-content > div {
    margin-bottom: 20px;
}

.idiom-content h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.idiom-content h4::before {
    content: '📋';
}

.idiom-meaning h4::before {
    content: '📖';
}

.idiom-example h4::before {
    content: '💡';
}

.idiom-story h4::before {
    content: '📚';
}

.idiom-content p {
    line-height: 1.8;
    color: var(--text-primary);
}

/* AI成语接龙响应 */
.idiom-response-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.next-idiom {
    margin-bottom: 20px;
}

.next-idiom h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.idiom-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.idiom-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: var(--font-fun);
}

.idiom-pinyin-small {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.idiom-story-part h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.idiom-story-part p {
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
}

/* 继续成语输入区 */
.idiom-suggestions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.suggestions-label {
    color: var(--text-secondary);
}

.suggestion-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestion-item {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.suggestion-item:hover {
    background: var(--secondary-color);
    color: var(--text-white);
    transform: translateY(-2px);
}

/* 成语统计 */
.idiom-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.idiom-stats .stats-item .stats-icon {
    color: var(--secondary-color);
}

.idiom-stats .stats-value {
    color: var(--secondary-color);
}

/* 成语输入状态 */
.idiom-input-wrapper input.valid {
    border-color: var(--success-color);
}

.idiom-input-wrapper input.invalid {
    border-color: var(--error-color);
}

.idiom-input-wrapper input.loading {
    background: var(--bg-tertiary);
}

/* 动画效果 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.idiom-highlight {
    animation: pulse 0.6s ease;
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
}

/* 模态框样式增强 */
.modal-large {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
}

/* 统计模态框样式 */
.stats-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.stats-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.stats-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-section {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
}

.progress-section h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.streak-info {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
}

.streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 15px;
}

.streak-day {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all var(--transition-normal);
}

.streak-day.active {
    background: var(--success-color);
    color: var(--text-white);
}

.streak-day.today {
    border: 2px solid var(--primary-color);
}

/* 成就系统样式 */
.achievement-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.achievement-category {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.achievement-category.active {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.achievement-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-color);
    position: relative;
}

.achievement-card.unlocked {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement-card.unlocked .achievement-icon {
    filter: grayscale(0);
    opacity: 1;
}

.achievement-title {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.achievement-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.achievement-progress {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.achievement-card.unlocked .achievement-progress {
    color: var(--success-color);
}

.achievement-date {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 10px;
}

.achievement-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.9rem;
}

/* 工具按钮增强 */
.tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* 学习连击效果 */
.streak-fire {
    animation: fire 1s ease-in-out infinite;
}

@keyframes fire {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
    }
}

/* 成就解锁动画 */
.achievement-unlock {
    animation: achievementPop 0.6s ease;
}

@keyframes achievementPop {
    0% {
        transform: scale(0.8) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 进度条动画 */
.progress-animated {
    animation: progressGrow 1s ease-out;
}

@keyframes progressGrow {
    from {
        width: 0 !important;
    }
}

/* 成就通知 */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--success-color);
    max-width: 300px;
    z-index: 2000;
    animation: slideInRight 0.5s ease;
}

.achievement-notification h4 {
    color: var(--success-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-notification p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .modal-large {
        width: 95%;
        max-height: 95vh;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .achievement-categories {
        justify-content: center;
    }
    
    .achievement-summary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .streak-calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 3px;
    }
    
    .streak-day {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
}

/* 打印样式 */
@media print {
    .header,
    .mode-selector,
    .control-panel,
    .story-stats,
    .idiom-stats,
    .footer {
        display: none;
    }
    
    .story-display,
    .idiom-game-display {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}